package com.community.service.impl;

import com.community.common.utils.DateUtils;
import com.community.common.utils.SecurityUtils;
import com.community.domain.ServeTypeEntity;
import com.community.mapper.ServeTypeMapper;
import com.community.service.ServeTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ServeTypeServiceImpl implements ServeTypeService {
    @Autowired
    private ServeTypeMapper serveTypeMapper;
    @Override
    public List<ServeTypeEntity> selectServeTypeList(ServeTypeEntity s) {
        return serveTypeMapper.selectServeTypeList(s);
    }

    @Override
    public Integer addServeType(ServeTypeEntity s) {
        s.setCreateTime(DateUtils.getNowDate());
        s.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
        return serveTypeMapper.addServeType(s);
    }

    @Override
    public Integer updateServeType(ServeTypeEntity s) {
        return serveTypeMapper.updateServeType(s);
    }

    @Override
    public Integer deleteServeType(Integer id) {
        return serveTypeMapper.deleteServeType(id);
    }

    @Override
    public List<ServeTypeEntity> select(ServeTypeEntity s) {
        return serveTypeMapper.select(s);
    }

}
